package info.yangguo.pojo;

/**
 * @author:杨果
 * @date:16/10/2 上午11:51
 *
 * Description:
 *
 */
public class RequestAttribute {
    private RequestType requestType;
    private RequestGrade requestGrade;

    public RequestType getRequestType() {
        return requestType;
    }

    public void setRequestType(RequestType requestType) {
        this.requestType = requestType;
    }

    public RequestGrade getRequestGrade() {
        return requestGrade;
    }

    public void setRequestGrade(RequestGrade requestGrade) {
        this.requestGrade = requestGrade;
    }

    public enum RequestType {
        /**
         * 无需应答，一方接收到消息数据包后，不管是否错误，都不应答
         */
        RT00("00"),
        /**
         * 保留
         */
        RT01("01"),
        /**
         * 选择应答，一方接收到消息数据包后，若数据检验正确，则不应答；若数据检验错误，则回复错误应答。
         */
        RT10("10"),
        /**
         * 选择应答，一方接收到消息数据包后，若数据检验正确，则不应答；若数据检验错误，则回复错误应答。
         */
        RT11("11");

        private String value;

        RequestType(String value) {
            this.value = value;
        }

        public String getValue() {
            return value;
        }

        @Override
        public String toString() {
            return "RequestType{" +
                    "value='" + value + '\'' +
                    '}';
        }
    }

    public enum RequestGrade {
        RG0("0"), RG1("1"), RG2("2"), RG3("3"), RG4("4"), RG5("5"),
        RG6("6"), RG7("7"), RG8("8"), RG9("9"), RGA("A"), RGB("B"),
        RGC("C"), RGD("D"), RGE("E"), RGF("F");

        private String value;

        RequestGrade(String value) {
            this.value = value;
        }

        public String getValue() {
            return value;
        }

        @Override
        public String toString() {
            return "RequestGrade{" +
                    "value='" + value + '\'' +
                    '}';
        }
    }

    @Override
    public String toString() {
        return "RequestAttribute{" +
                "requestType=" + requestType +
                ", requestGrade=" + requestGrade +
                '}';
    }
}
